//
//  MLSegmentBar.h
//  MLSegmentBar
//
//  Created by dreamforstar on 2018/4/21.
//  Copyright © 2018年 com.jiankeyan. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MLSegmentBarConfig.h"
#import "UIView+MLSegmentBar.h"
@class MLSegmentBar;
@protocol MLSegmentBarDelegate <NSObject>
/**代理方法*/
- (void)segmentBar:(MLSegmentBar *)segmentBar didSelectIndex:(NSInteger)toIndex fromIndex:(NSInteger)fromIndex;
@end

@interface MLSegmentBar : UIView

/**选项卡数据源,内部指定的都是字符串类型*/
@property (nonatomic, strong) NSArray <NSString *>*items;
/** 代理*/
@property (nonatomic, weak) id<MLSegmentBarDelegate> delegate;
/** 当前选中的索引*/
@property (nonatomic, assign) NSInteger selectIndex;

/**
 快速创建一个选项卡
 @param frame 选项卡的frame
 @return 选项卡
 */
+ (instancetype)segmentBarWithFrame:(CGRect)frame;

- (void)updateWithConfig:(void(^)(MLSegmentBarConfig *config))configBlock;


@end
